package com.dao;

import com.entity.TD_tblPartychangelog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.sql.Date;
import java.util.List;

public interface TD_tblPartychangelogDao extends JpaRepository<TD_tblPartychangelog,Integer> {

    /**
     * 最后一次换届改选日期和操作人姓名
     * @param branchId 组织id
     * @return
     */
    @Query(value = "select top 1 fd_date,fd_userName from TD_tblPartychangelog where fd_BranchID=? order by fd_date DESC",nativeQuery = true)
    public List<Object[]> lastChangeLeader(int branchId);
}
